package edu.bw.service.impl;

import edu.bw.service.UserService;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)//配置作用范围，单例/多例
public class UserServiceImpl03 implements UserService {
    public UserServiceImpl03(){
        System.out.println(this+"构造方法被调用");
    }
    @PostConstruct
    public void init(){
        System.out.println(this+"被初始化");
    }
    @PreDestroy
    public void destroy(){
        System.out.println(this+"被销毁");
    }


}
